import sys

def isfloat(x: str) -> bool:
    try:
        x = float(x)
    except:
        return False
    return True 

m = 0.0
starttime = 0.0
endtime = 0.0

for line in sys.stdin.readlines():
    data = line.split(' ')
    if(len(data) < 1): continue
    if data[0] == 'CMDLINE': 
        for i in data:
            if i != 'CMDLINE': print(i, end = ' ')
        print()
    if(len(data) < 2 or (not isfloat(data[1]))): continue
    m = max(float(data[1]), m)
    if(starttime == 0.0):
        starttime = float(data[2])
    endtime = max(float(data[2]), endtime)

print("Max memory = " + str(m))
print("Time = " + str(endtime - starttime))